package com.sumainfor.pc.gmio.controller.assistant;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sumainfor.common.util.JsonResult;
import com.sumainfor.pc.gmio.service.SurrenderService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @Author Eddy·Chen
 * @Email 835033913@qq.com
 * @Create 2019-03-29 19:07
 * 退租验收
 */
@RestController
@RequestMapping("/surrender")
public class SurrenderController {

    @Autowired
    private SurrenderService service;


    /**
     * 获得表格数据
     *
     * @param params MiId: 服务中心编号
     *               City:城市名称
     *               District:区名称
     *               ComName:小区名称
     *               Date:时间 (格式 yyyy-MM-dd)
     * @param page
     * @return
     */
    @RequestMapping("/getTableList")
    public JsonResult getTableList(@RequestParam Map<String, Object> params, Page page) {
        return service.getTableList(params, page);
    }


    /**
     * 获取详细信息数据
     *
     * @param witId 主表编号
     * @return
     */
    @RequestMapping("/getInfo")
    public JsonResult getInfo(String witId) {
        if (StringUtils.isBlank(witId)) {
            return JsonResult.errorForEmpty();
        }
        return service.getInfo(witId);
    }

}
